package juc.lock;

import java.util.concurrent.TimeUnit;


public class Test3 {

    public static void main(String[] args) {

        //2个对象，2把锁
        Phone phone = new Phone();
        Phone phone1 = new Phone();


        new Thread(()->{
            phone.sendMsg();
        },"a").start();
        try {
            TimeUnit.SECONDS.sleep(1);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        new Thread(()->{
            phone1.call();
        },"b").start();


    }


}


